var __extends =
    (this && this.__extends) ||
    (function () {
      var e = function (t, i) {
        return (e =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (e, t) {
              e.__proto__ = t;
            }) ||
          function (e, t) {
            for (var i in t)
              Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
          })(t, i);
      };
      return function (t, i) {
        function a() {
          this.constructor = t;
        }
        if ("function" != typeof i && null !== i)
          throw new TypeError(
            "Class extends value " + String(i) + " is not a constructor or null"
          );
        e(t, i),
          (t.prototype =
            null === i
              ? Object.create(i)
              : ((a.prototype = i.prototype), new a()));
      };
    })(),
  WorldCupHistoryView = (function (e) {
    function t() {
      var t = e.call(this) || this;
      return (
        (t.dashenArray = []),
        t.btn_worldCupHisback.on(Laya.Event.CLICK, t, t.onCancleBtnClickFn),
        WebSocketService.addListener({
          caller: t,
          code: 221123,
          method: t.onLoadWorldCupPeiLvData,
        }),
        WebSocketService.addListener({
          caller: t,
          code: 221126,
          method: t.onLoadWorldCupJingCaiData,
        }),
        WebSocketService.addListener({
          caller: t,
          code: 221127,
          method: t.onLoadWorldCupSaiKuangData,
        }),
        WebSocketService.addListener({
          caller: t,
          code: 221128,
          method: t.onLoadWorldCupDaShenBangData,
        }),
        WebSocketService.addListener({
          caller: t,
          code: 221129,
          method: t.onLoadWorldCupDaShenBangData,
        }),
        (t.list_jiangcai_his.vScrollBarSkin = ""),
        (t.list_jingcai_single.vScrollBarSkin = ""),
        (t.list_worldcup_saikuang.vScrollBarSkin = ""),
        (t.list_yucedashen_bang.vScrollBarSkin = ""),
        t
      );
    }
    return (
      __extends(t, e),
      (t.openWorldCupHistoryView = function (e) {
        return (
          null == this.worldCupV && (this.worldCupV = new t()),
          this.worldCupV.initData(e),
          this.worldCupV
        );
      }),
      (t.prototype.initData = function (e) {
        (this.label_yuce_history.visible = !1),
          (this.label_jingcai_history.visible = !1),
          (this.label_worldcup_saicheng.visible = !1),
          (this.label_dashen_bang.visible = !1),
          "1" == e
            ? ((this.label_worldcup_his_title.text = "预测记录"),
              WebSocketService.send({ c: 221123, d: { pageNum: 0 } }),
              (this.label_yuce_history.visible = !0))
            : "2" == e
            ? ((this.label_worldcup_his_title.text = "竞猜记录"),
              WebSocketService.send({ c: 221126, d: { pageNum: 0 } }),
              (this.label_jingcai_history.visible = !0))
            : "3" == e
            ? ((this.label_worldcup_his_title.text = "赛况"),
              WebSocketService.send({ c: 221127, d: { pageNum: 0 } }),
              (this.label_worldcup_saicheng.visible = !0))
            : "4" == e
            ? ((this.label_dashen_bang.visible = !0),
              (this.label_worldcup_his_title.text = "预测大神榜"),
              WebSocketService.send({ c: 221128, d: { pageNum: 0 } }))
            : "5" == e &&
              ((this.label_dashen_bang.visible = !0),
              (this.label_worldcup_his_title.text = "竞猜大神榜"),
              WebSocketService.send({ c: 221129, d: { pageNum: 0 } }));
      }),
      (t.prototype.onLoadWorldCupPeiLvData = function (e) {
        if (e.list) {
          var t = e.list;
          if (t && t.length > 0) {
            (this.tempArray = e.list), (this.list_jiangcai_his.visible = !0);
            var i = void 0;
            this.tempArray = [];
            for (var a = 0; a < t.length; a++) {
              var r = t[a];
              (i = {
                item0: { text: e.more.roleName + " 预测：" + r.countryName },
                item6: { text: "x" + r.betForChampion },
                item7: { text: "x" + r.betFor2 },
                item8: { text: "x" + r.betFor4 },
                item9: { text: "x" + r.betFor8 },
                item10: { text: "x" + r.betFor16 },
              }),
                this.tempArray.push(i);
            }
            this.list_jiangcai_his.dataSource = this.tempArray;
          } else this.list_jiangcai_his.visible = !1;
        }
      }),
      (t.prototype.onLoadWorldCupJingCaiData = function (e) {
        if (e.list) {
          var t = e.list;
          if (t && t.length > 0) {
            (this.jingcaiArray = e.list),
              (this.list_jingcai_single.visible = !0);
            var i = void 0;
            this.jingcaiArray = [];
            for (var a = 0; a < t.length; a++) {
              var r = t[a];
              (i = {
                item00: { text: "竞猜：" + r.homeTeam },
                item11: { text: "x" + r.betForWin },
                item12: { text: "x" + r.betForEven },
                item13: { text: "x" + r.betForLose },
                item14: { text: "x" + r.betGoals1 },
                item15: { text: "x" + r.betGoals2 },
                item16: { text: "x" + r.betGoals3 },
                item17: { text: "x" + r.betGoals4 },
              }),
                this.jingcaiArray.push(i);
            }
            this.list_jingcai_single.dataSource = this.jingcaiArray;
          } else this.list_jingcai_single.visible = !1;
        }
      }),
      (t.prototype.onLoadWorldCupSaiKuangData = function (e) {
        var t = e.list;
        if (
          ((this.list_worldcup_saikuang.visible = !0),
          (this.saikuangArray = []),
          t && t.length > 0)
        )
          for (var i = e.list, a = void 0, r = 0; r < i.length; r++) {
            (a = {
              item20: { text: "未结算" },
              item21: { text: (n = i[r]).homeTeamName },
              item22: { text: n.guestTeamName },
              item23: { text: n.homeTeamScore },
              item24: { text: n.guestTeamScore },
            }),
              this.saikuangArray.push(a);
          }
        var o = e.more;
        if (o && o.length > 0)
          for (var s = e.more, a = void 0, r = 0; r < s.length; r++) {
            var n = s[r];
            (a = {
              item20: { text: "已完成" },
              item21: { text: n.homeTeamName },
              item22: { text: n.guestTeamName },
              item23: { text: n.homeTeamScore },
              item24: { text: n.guestTeamScore },
            }),
              this.saikuangArray.push(a);
          }
        this.list_worldcup_saikuang.dataSource = this.saikuangArray;
      }),
      (t.prototype.onLoadWorldCupDaShenBangData = function (e) {
        if (e.list) {
          var t = e.list;
          if (t && t.length > 0) {
            (this.dashenArray = e.list),
              (this.list_yucedashen_bang.visible = !0);
            var i = void 0;
            this.dashenArray = [];
            for (var a = 0; a < t.length; a++) {
              var r = t[a];
              (i = {
                item_yucedashen_index: { text: "第" + (a + 1) + "名：" },
                item_yucedashen_name: { text: "" + r.roleName },
                item_yucedashen_award: { text: r.award + "金" },
              }),
                this.dashenArray.push(i);
            }
            this.list_yucedashen_bang.dataSource = this.dashenArray;
          } else this.list_yucedashen_bang.visible = !1;
        }
      }),
      (t.prototype.onCancleBtnClickFn = function () {
        this.removeSelf();
      }),
      t
    );
  })(ui.ActivityController.WorldCupHistoryViewUI);
